'use strict';

module.exports = app => {
  const { STRING, INTEGER, DATE } = app.Sequelize;

  return app.model.define('t_user', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    username: {
      type: STRING(255),
      allowNull: true,
    },
    roleId: {
      type: STRING(255),
      field: 'role_id',
      allowNull: true,
    },
    password: {
      type: STRING(255),
      allowNull: true,
    },
    realName: {
      type: STRING(255),
      field: 'real_name',
      defaultValue: 'wangwq',
    },
    logicDelete: {
      type: INTEGER,
      field: 'logic_delete',
      defaultValue: 0,
    },
    createdTime: {
      type: DATE,
      field: 'created_time',
      defaultValue: null,
    },
    updatedTime: {
      type: DATE,
      field: 'updated_time',
      defaultValue: null,
    },
  });
};
